from rest_framework import serializers

from xj_users.models import Gathering



#



# class EventSerializerUser(serializers.ModelSerializer):
#     class Meta:
#         model = Gathering
#         fields = ["users"]
#
# class EventSerializerSimple(serializers.ModelSerializer):
#     users = EventSerializerUser(many = True)
#     class Meta:
#         model = Gathering
#         fields = ["id","name","image","city","starttime","endrolltime","users"]


class EventSerializerSimple(serializers.ModelSerializer):
    class Meta:
        model = Gathering
        fields = ["id","name","image","city","starttime","endrolltime","users"]




# 活动详情和报名活动
class EventSerializer(serializers.ModelSerializer):
    class Meta:
        model = Gathering
        fields = "__all__"